#!/bin/bash

if [ ! -d $1 ]; then
	echo "First parameter must be the deployment directory!" 1>&2
	exit 1
fi

cd $1
. config

trap 'max-syscall deploy_clearall; exit $?' INT TERM EXIT
max-syscall deploy_setfile "$NAME-$VERSION.stuff"

./bundlepeer -n "$NAME" -v "$VERSION" -b "$BID" &

#exec $START # Andrew - we want trap to trigger!
sh -c "$START"

